Don't modify global active weight when changing weight of inactive domain.
authorack@localhost.localdomain <ack@localhost.localdomain>
Fri, 30 Jun 2006 16:12:05 +0000 (17:12 +0100)
committerack@localhost.localdomain <ack@localhost.localdomain>
Fri, 30 Jun 2006 16:12:05 +0000 (17:12 +0100)
Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
xen/common/sched_credit.c

index 3b804cd6441a11916dbe123674967eeef4b145d5..98e1e3e6c1c8dcbc5dfb6bc476049a7a7a057d4c 100644 (file)
@@ -622,9 +622,12 @@ csched_dom_cntl(
 
         if ( cmd->u.credit.weight != 0 )
         {
-            csched_priv.weight -= sdom->weight;
+            if ( !list_empty(&sdom->active_sdom_elem) )
+            {
+                csched_priv.weight -= sdom->weight;
+                csched_priv.weight += cmd->u.credit.weight;
+            }
             sdom->weight = cmd->u.credit.weight;
-            csched_priv.weight += sdom->weight;
         }
 
         if ( cmd->u.credit.cap != (uint16_t)~0U )